package com.yao.shop.task;

import com.yao.shop.service.ShopCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ShopCouponTask {

    @Autowired
    private ShopCouponService shopCouponService;

    /**
     * 每分钟更新一次过期时间
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    public void refreshCouponStatus() {
        shopCouponService.updateTimeoutCoupon();
    }

}